/* Editor */

:root {
  --source-editor-fieldset-height: 44px;
}

.source-editor-wrapper {
  position: fixed;
  top: calc(var(--header-height) + var(--source-editor-fieldset-height));
  right: 0;
  bottom: 0;
  left: var(--aside-width);
}

.dropdown {
  display: flex;
  height: 100%;
  margin: 0;
}

.dropdown .selected::before {
  content: "›";
}

.dropdown > li {
  position: relative;
  height: var(--source-editor-fieldset-height);
  margin-right: 10px;
  line-height: var(--source-editor-fieldset-height);
  cursor: default;
}

.dropdown button {
  color: inherit;
}

.dropdown > li > ul {
  position: absolute;
  top: var(--source-editor-fieldset-height);
  z-index: var(--z-index-floating-ui);
  display: none;
  width: 500px;
  max-height: 400px;
  margin-left: -10px;
  overflow-y: auto;
  line-height: 1.5;
  background-color: var(--color-background);
  border: 1px solid var(--color-background-darker);
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
  box-shadow: 0 3px 6px var(--color-transparent-black);
}

.dropdown > li > ul > li {
  padding: 2px 10px;
}

.dropdown > li > ul > li span {
  float: right;
}

.dropdown li:hover > ul {
  display: block;
}

.CodeMirror-gutters {
  background: var(--color-sidebar-background);
  border-right: 1px solid var(--color-sidebar-border);
}

.CodeMirror.CodeMirror {
  margin-bottom: 1em;
  font: 13px var(--font-family-editor);
  border: 1px solid var(--color-sidebar-border);
}

.source-form {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  left: var(--aside-width);
  background: var(--color-sidebar-background);
}

.source-form .fieldset {
  height: var(--source-editor-fieldset-height);
  padding-left: 0.5em;
  border-bottom: 1px solid var(--color-sidebar-border);
}

.source-form .fieldset > button {
  margin: 0;
}

.source-form .CodeMirror-lines {
  border-top: 1px solid var(--color-sidebar-border);
}

.source-form .CodeMirror,
.source-form textarea {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
}

.source-slice-editor-form .CodeMirror {
  height: auto;
}

.cm-trailingspace {
  background-color: var(--color-editor-trailing-whitespace);
}

.cm-section {
  padding-right: 10px;
  font-weight: 500;
  color: var(--color-editor-comment);
  border: solid 1px var(--color-editor-comment);
  border-radius: 2px;
}

.cm-comment {
  color: var(--color-editor-comment);
}

.cm-date {
  color: var(--color-editor-date);
}

.cm-directive {
  font-weight: 500;
  color: var(--color-editor-directive);
}

.cm-option {
  color: var(--color-editor-class);
}

.cm-account {
  color: var(--color-editor-account);
}

.cm-invalid {
  color: var(--color-editor-invalid);
}

.CodeMirror-hint {
  max-width: 600px;
}

.CodeMirror-hint .highlight {
  font-weight: 500;
}
